{include file="header"}
<div class="x-body">
      <form class="layui-form">
	  <input type="hidden" name="model" value="cateAdmin">
      <xblock>
		<a class="layui-btn" onclick="x_admin_show('添加分类','{:url('admin/com/cate_add')}')"><i class="layui-icon"></i>添加</a>
      </xblock>
      <div  style="overflow: auto;">
        <table class="layui-table" style="min-width: 1000px;">
        <colgroup>
          <col width="100">
          <col width="100">
          <col width="200">
          <col width="200">
          <col>
        </colgroup>
        <thead>
          <tr>
            <th>ID</th>
            <th>排序</th>
            <th>分类名</th>
			<th>别名</th>
			<th>图片</th>
			<th>状态</th>
			<th>导航</th>
            <th>操作</th>
        </tr></thead>
        <tbody>
		{volist name=":fun_s('cate',array('tid'=>0),'px desc',20,1)" id="vo"}
		<!--顶级-->
          <tr>
            <td>{$vo.id}</td>
            <td>{$vo.px}</td>
            <td><a target="_blank" href="{:url('index/index/cate',array('alias'=>$vo.alias))}">{$vo.name}</a></td>
			<td>{$vo.alias}</td>
			<td><img src="{:dingyi($vo.pic,'/public/img/ico.png')}" style="height: 30px;width: 30px;"></td>
			<td>
			<input type="checkbox" lay-skin="switch" url="{:url("admin/api/uindex")}?id={$vo.id}&model=cate&or=open" lay-submit lay-filter="index" value="{$vo.id}" lay-text="显示|显示"  {if condition="$vo['open'] eq 1"}checked{/if}>
			</td>
			<td>
			<input type="checkbox" lay-skin="switch" url="{:url("admin/api/uindex")}?id={$vo.id}&model=cate&or=header" lay-submit lay-filter="index" value="{$vo.id}" lay-text="显示|显示"  {if condition="$vo['header'] eq 1"}checked{/if}>
			</td>
            <td class="td-manage">
			  <a class="layui-btn layui-btn-sm" onclick="x_admin_show('编辑分类','{:url('admin/com/cate_add')}?id={$vo.id}')"><i class="layui-icon"></i>编辑</a>
			  {if !fun_st('cate', array('tid'=>$vo.id))}
              <a class="layui-btn layui-btn-sm layui-btn-danger del_t" url="{:url('admin/api/catedelete')}?model=cate&id={$vo.id}" name="确定要删除这条记录吗？</br>确定会同时删除该分类下的文章数据"><i class="layui-icon"></i>删除</a>
              {/if}
            </td>
          </tr>
		  {volist name=":fun_s('cate',array('tid'=>$vo.id),'px desc',200,1)" id="v"}
		  <!--二级-->
          <tr>
            <td>{$v.id}</td>
            <td>{$v.px}</td>
            <td>——<a target="_blank" href="{:url('index/index/cate',array('alias'=>$v.alias))}">{$v.name}</a></td>
			<td>{$v.alias}</td>
			<td><img src="{:dingyi($v.pic,'/public/img/ico.png')}" style="height: 30px;width: 30px;"></td>
			<td>
			<input type="checkbox" lay-skin="switch" url="{:url("admin/api/uindex")}?id={$v.id}&model=cate&or=open" lay-submit lay-filter="index" value="{$v.id}" lay-text="显示|显示"  {if condition="$v['open'] eq 1"}checked{/if}>
			</td>
			<td>
			<input type="checkbox" lay-skin="switch" url="{:url("admin/api/uindex")}?id={$v.id}&model=cate&or=header" lay-submit lay-filter="index" value="{$v.id}" lay-text="显示|显示"  {if condition="$v['header'] eq 1"}checked{/if}>
			</td>
            <td class="td-manage">
			  <a class="layui-btn layui-btn-sm" onclick="x_admin_show('编辑分类','{:url('admin/com/cate_add')}?id={$v.id}')"><i class="layui-icon"></i>编辑</a>
              <a class="layui-btn layui-btn-sm layui-btn-danger del_t" url="{:url('admin/api/catedelete')}?model=cate&id={$v.id}" name="确定要删除这条记录吗？</br>确定会同时删除该分类下的文章数据"><i class="layui-icon"></i>删除</a>
            </td>
          </tr>
		  {/volist}
		  {/volist}
        </tbody>
      </table>
      </div>
	  </form>
    </div>
  {include file="footer"}